.class public Lcom/hyphenate/chat/EMContactManager;
.super Ljava/lang/Object;


# instance fields
.field private contactImpl:Lcom/hyphenate/chat/EMContactManager$EMAContactListenerImpl;

.field private contactListeners:Ljava/util/List;

.field emaObject:Lcom/hyphenate/chat/adapter/EMAContactManager;

.field mClient:Lcom/hyphenate/chat/EMClient;


# direct methods
.method constructor <init>(Lcom/hyphenate/chat/EMClient;Lcom/hyphenate/chat/adapter/EMAContactManager;)V
    .locals 2

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    invoke-static {v0}, Ljava/util/Collections;->synchronizedList(Ljava/util/List;)Ljava/util/List;

    move-result-object v0

    iput-object v0, p0, Lcom/hyphenate/chat/EMContactManager;->contactListeners:Ljava/util/List;

    new-instance v0, Lcom/hyphenate/chat/EMContactManager$EMAContactListenerImpl;

    invoke-direct {v0, p0}, Lcom/hyphenate/chat/EMContactManager$EMAContactListenerImpl;-><init>(Lcom/hyphenate/chat/EMContactManager;)V

    iput-object v0, p0, Lcom/hyphenate/chat/EMContactManager;->contactImpl:Lcom/hyphenate/chat/EMContactManager$EMAContactListenerImpl;

    iput-object p1, p0, Lcom/hyphenate/chat/EMContactManager;->mClient:Lcom/hyphenate/chat/EMClient;

    new-instance v0, Lcom/hyphenate/chat/adapter/EMAContactManager;

    invoke-direct {v0, p2}, Lcom/hyphenate/chat/adapter/EMAContactManager;-><init>(Lcom/hyphenate/chat/adapter/EMAContactManager;)V

    iput-object v0, p0, Lcom/hyphenate/chat/EMContactManager;->emaObject:Lcom/hyphenate/chat/adapter/EMAContactManager;

    iget-object v0, p0, Lcom/hyphenate/chat/EMContactManager;->emaObject:Lcom/hyphenate/chat/adapter/EMAContactManager;

    iget-object v1, p0, Lcom/hyphenate/chat/EMContactManager;->contactImpl:Lcom/hyphenate/chat/EMContactManager$EMAContactListenerImpl;

    invoke-virtual {v0, v1}, Lcom/hyphenate/chat/adapter/EMAContactManager;->registerContactListener(Lcom/hyphenate/chat/adapter/EMAContactListener;)V

    return-void
.end method

.method static synthetic access$000(Lcom/hyphenate/chat/EMContactManager;)Ljava/util/List;
    .locals 1

    iget-object v0, p0, Lcom/hyphenate/chat/EMContactManager;->contactListeners:Ljava/util/List;

    return-object v0
.end method

.method private handleError(Lcom/hyphenate/chat/adapter/EMAError;)V
    .locals 1

    invoke-virtual {p1}, Lcom/hyphenate/chat/adapter/EMAError;->errCode()I

    move-result v0

    if-eqz v0, :cond_0

    new-instance v0, Lcom/hyphenate/exceptions/HyphenateException;

    invoke-direct {v0, p1}, Lcom/hyphenate/exceptions/HyphenateException;-><init>(Lcom/hyphenate/chat/adapter/EMAError;)V

    throw v0

    :cond_0
    return-void
.end method


# virtual methods
.method public acceptInvitation(Ljava/lang/String;)V
    .locals 2

    new-instance v0, Lcom/hyphenate/chat/adapter/EMAError;

    invoke-direct {v0}, Lcom/hyphenate/chat/adapter/EMAError;-><init>()V

    iget-object v1, p0, Lcom/hyphenate/chat/EMContactManager;->emaObject:Lcom/hyphenate/chat/adapter/EMAContactManager;

    invoke-virtual {v1, p1, v0}, Lcom/hyphenate/chat/adapter/EMAContactManager;->acceptInvitation(Ljava/lang/String;Lcom/hyphenate/chat/adapter/EMAError;)V

    invoke-direct {p0, v0}, Lcom/hyphenate/chat/EMContactManager;->handleError(Lcom/hyphenate/chat/adapter/EMAError;)V

    return-void
.end method

.method public addContact(Ljava/lang/String;Ljava/lang/String;)V
    .locals 2

    new-instance v0, Lcom/hyphenate/chat/adapter/EMAError;

    invoke-direct {v0}, Lcom/hyphenate/chat/adapter/EMAError;-><init>()V

    iget-object v1, p0, Lcom/hyphenate/chat/EMContactManager;->emaObject:Lcom/hyphenate/chat/adapter/EMAContactManager;

    invoke-virtual {v1, p1, p2, v0}, Lcom/hyphenate/chat/adapter/EMAContactManager;->inviteContact(Ljava/lang/String;Ljava/lang/String;Lcom/hyphenate/chat/adapter/EMAError;)V

    invoke-direct {p0, v0}, Lcom/hyphenate/chat/EMContactManager;->handleError(Lcom/hyphenate/chat/adapter/EMAError;)V

    return-void
.end method

.method public addUserToBlackList(Ljava/lang/String;Z)V
    .locals 2

    new-instance v0, Lcom/hyphenate/chat/adapter/EMAError;

    invoke-direct {v0}, Lcom/hyphenate/chat/adapter/EMAError;-><init>()V

    iget-object v1, p0, Lcom/hyphenate/chat/EMContactManager;->emaObject:Lcom/hyphenate/chat/adapter/EMAContactManager;

    invoke-virtual {v1, p1, p2, v0}, Lcom/hyphenate/chat/adapter/EMAContactManager;->addToBlackList(Ljava/lang/String;ZLcom/hyphenate/chat/adapter/EMAError;)V

    invoke-direct {p0, v0}, Lcom/hyphenate/chat/EMContactManager;->handleError(Lcom/hyphenate/chat/adapter/EMAError;)V

    return-void
.end method

.method public asyncAcceptInvitation(Ljava/lang/String;Lcom/hyphenate/EMCallBack;)V
    .locals 2

    invoke-static {}, Lcom/hyphenate/chat/EMClient;->getInstance()Lcom/hyphenate/chat/EMClient;

    move-result-object v0

    new-instance v1, Lcom/hyphenate/chat/EMContactManager$8;

    invoke-direct {v1, p0, p1, p2}, Lcom/hyphenate/chat/EMContactManager$8;-><init>(Lcom/hyphenate/chat/EMContactManager;Ljava/lang/String;Lcom/hyphenate/EMCallBack;)V

    invoke-virtual {v0, v1}, Lcom/hyphenate/chat/EMClient;->execute(Ljava/lang/Runnable;)V

    return-void
.end method

.method public asyncDeclineInvitation(Ljava/lang/String;Lcom/hyphenate/EMCallBack;)V
    .locals 2

    invoke-static {}, Lcom/hyphenate/chat/EMClient;->getInstance()Lcom/hyphenate/chat/EMClient;

    move-result-object v0

    new-instance v1, Lcom/hyphenate/chat/EMContactManager$9;

    invoke-direct {v1, p0, p1, p2}, Lcom/hyphenate/chat/EMContactManager$9;-><init>(Lcom/hyphenate/chat/EMContactManager;Ljava/lang/String;Lcom/hyphenate/EMCallBack;)V

    invoke-virtual {v0, v1}, Lcom/hyphenate/chat/EMClient;->execute(Ljava/lang/Runnable;)V

    return-void
.end method

.method public asyncSaveBlackList(Ljava/util/List;Lcom/hyphenate/EMCallBack;)V
    .locals 2

    invoke-static {}, Lcom/hyphenate/chat/EMClient;->getInstance()Lcom/hyphenate/chat/EMClient;

    move-result-object v0

    new-instance v1, Lcom/hyphenate/chat/EMContactManager$7;

    invoke-direct {v1, p0, p1, p2}, Lcom/hyphenate/chat/EMContactManager$7;-><init>(Lcom/hyphenate/chat/EMContactManager;Ljava/util/List;Lcom/hyphenate/EMCallBack;)V

    invoke-virtual {v0, v1}, Lcom/hyphenate/chat/EMClient;->execute(Ljava/lang/Runnable;)V

    return-void
.end method

.method public aysncAddContact(Ljava/lang/String;Ljava/lang/String;Lcom/hyphenate/EMCallBack;)V
    .locals 2

    invoke-static {}, Lcom/hyphenate/chat/EMClient;->getInstance()Lcom/hyphenate/chat/EMClient;

    move-result-object v0

    new-instance v1, Lcom/hyphenate/chat/EMContactManager$1;

    invoke-direct {v1, p0, p1, p2, p3}, Lcom/hyphenate/chat/EMContactManager$1;-><init>(Lcom/hyphenate/chat/EMContactManager;Ljava/lang/String;Ljava/lang/String;Lcom/hyphenate/EMCallBack;)V

    invoke-virtual {v0, v1}, Lcom/hyphenate/chat/EMClient;->execute(Ljava/lang/Runnable;)V

    return-void
.end method

.method public aysncAddUserToBlackList(Ljava/lang/String;ZLcom/hyphenate/EMCallBack;)V
    .locals 2

    invoke-static {}, Lcom/hyphenate/chat/EMClient;->getInstance()Lcom/hyphenate/chat/EMClient;

    move-result-object v0

    new-instance v1, Lcom/hyphenate/chat/EMContactManager$4;

    invoke-direct {v1, p0, p1, p2, p3}, Lcom/hyphenate/chat/EMContactManager$4;-><init>(Lcom/hyphenate/chat/EMContactManager;Ljava/lang/String;ZLcom/hyphenate/EMCallBack;)V

    invoke-virtual {v0, v1}, Lcom/hyphenate/chat/EMClient;->execute(Ljava/lang/Runnable;)V

    return-void
.end method

.method public aysncDeleteContact(Ljava/lang/String;Lcom/hyphenate/EMCallBack;)V
    .locals 2

    invoke-static {}, Lcom/hyphenate/chat/EMClient;->getInstance()Lcom/hyphenate/chat/EMClient;

    move-result-object v0

    new-instance v1, Lcom/hyphenate/chat/EMContactManager$2;

    invoke-direct {v1, p0, p1, p2}, Lcom/hyphenate/chat/EMContactManager$2;-><init>(Lcom/hyphenate/chat/EMContactManager;Ljava/lang/String;Lcom/hyphenate/EMCallBack;)V

    invoke-virtual {v0, v1}, Lcom/hyphenate/chat/EMClient;->execute(Ljava/lang/Runnable;)V

    return-void
.end method

.method public aysncGetAllContactsFromServer(Lcom/hyphenate/EMValueCallBack;)V
    .locals 2

    invoke-static {}, Lcom/hyphenate/chat/EMClient;->getInstance()Lcom/hyphenate/chat/EMClient;

    move-result-object v0

    new-instance v1, Lcom/hyphenate/chat/EMContactManager$3;

    invoke-direct {v1, p0, p1}, Lcom/hyphenate/chat/EMContactManager$3;-><init>(Lcom/hyphenate/chat/EMContactManager;Lcom/hyphenate/EMValueCallBack;)V

    invoke-virtual {v0, v1}, Lcom/hyphenate/chat/EMClient;->execute(Ljava/lang/Runnable;)V

    return-void
.end method

.method public aysncGetBlackListFromServer(Lcom/hyphenate/EMValueCallBack;)V
    .locals 2

    invoke-static {}, Lcom/hyphenate/chat/EMClient;->getInstance()Lcom/hyphenate/chat/EMClient;

    move-result-object v0

    new-instance v1, Lcom/hyphenate/chat/EMContactManager$6;

    invoke-direct {v1, p0, p1}, Lcom/hyphenate/chat/EMContactManager$6;-><init>(Lcom/hyphenate/chat/EMContactManager;Lcom/hyphenate/EMValueCallBack;)V

    invoke-virtual {v0, v1}, Lcom/hyphenate/chat/EMClient;->execute(Ljava/lang/Runnable;)V

    return-void
.end method

.method public aysncRemoveUserFromBlackList(Ljava/lang/String;Lcom/hyphenate/EMCallBack;)V
    .locals 2

    invoke-static {}, Lcom/hyphenate/chat/EMClient;->getInstance()Lcom/hyphenate/chat/EMClient;

    move-result-object v0

    new-instance v1, Lcom/hyphenate/chat/EMContactManager$5;

    invoke-direct {v1, p0, p1, p2}, Lcom/hyphenate/chat/EMContactManager$5;-><init>(Lcom/hyphenate/chat/EMContactManager;Ljava/lang/String;Lcom/hyphenate/EMCallBack;)V

    invoke-virtual {v0, v1}, Lcom/hyphenate/chat/EMClient;->execute(Ljava/lang/Runnable;)V

    return-void
.end method

.method public declineInvitation(Ljava/lang/String;)V
    .locals 2

    new-instance v0, Lcom/hyphenate/chat/adapter/EMAError;

    invoke-direct {v0}, Lcom/hyphenate/chat/adapter/EMAError;-><init>()V

    iget-object v1, p0, Lcom/hyphenate/chat/EMContactManager;->emaObject:Lcom/hyphenate/chat/adapter/EMAContactManager;

    invoke-virtual {v1, p1, v0}, Lcom/hyphenate/chat/adapter/EMAContactManager;->declineInvitation(Ljava/lang/String;Lcom/hyphenate/chat/adapter/EMAError;)V

    invoke-direct {p0, v0}, Lcom/hyphenate/chat/EMContactManager;->handleError(Lcom/hyphenate/chat/adapter/EMAError;)V

    return-void
.end method

.method public deleteContact(Ljava/lang/String;)V
    .locals 1

    const/4 v0, 0x0

    invoke-virtual {p0, p1, v0}, Lcom/hyphenate/chat/EMContactManager;->deleteContact(Ljava/lang/String;Z)V

    return-void
.end method

.method public deleteContact(Ljava/lang/String;Z)V
    .locals 2

    new-instance v0, Lcom/hyphenate/chat/adapter/EMAError;

    invoke-direct {v0}, Lcom/hyphenate/chat/adapter/EMAError;-><init>()V

    iget-object v1, p0, Lcom/hyphenate/chat/EMContactManager;->emaObject:Lcom/hyphenate/chat/adapter/EMAContactManager;

    invoke-virtual {v1, p1, v0, p2}, Lcom/hyphenate/chat/adapter/EMAContactManager;->deleteContact(Ljava/lang/String;Lcom/hyphenate/chat/adapter/EMAError;Z)V

    invoke-static {}, Lcom/hyphenate/chat/EMClient;->getInstance()Lcom/hyphenate/chat/EMClient;

    move-result-object v1

    invoke-virtual {v1}, Lcom/hyphenate/chat/EMClient;->chatManager()Lcom/hyphenate/chat/EMChatManager;

    move-result-object v1

    iget-object v1, v1, Lcom/hyphenate/chat/EMChatManager;->caches:Ljava/util/Map;

    invoke-interface {v1, p1}, Ljava/util/Map;->remove(Ljava/lang/Object;)Ljava/lang/Object;

    invoke-direct {p0, v0}, Lcom/hyphenate/chat/EMContactManager;->handleError(Lcom/hyphenate/chat/adapter/EMAError;)V

    return-void
.end method

.method public finalize()V
    .locals 0

    invoke-super {p0}, Ljava/lang/Object;->finalize()V

    return-void
.end method

.method public getAllContactsFromServer()Ljava/util/List;
    .locals 2

    new-instance v0, Lcom/hyphenate/chat/adapter/EMAError;

    invoke-direct {v0}, Lcom/hyphenate/chat/adapter/EMAError;-><init>()V

    iget-object v1, p0, Lcom/hyphenate/chat/EMContactManager;->emaObject:Lcom/hyphenate/chat/adapter/EMAContactManager;

    invoke-virtual {v1, v0}, Lcom/hyphenate/chat/adapter/EMAContactManager;->getContactsFromServer(Lcom/hyphenate/chat/adapter/EMAError;)Ljava/util/List;

    move-result-object v1

    invoke-direct {p0, v0}, Lcom/hyphenate/chat/EMContactManager;->handleError(Lcom/hyphenate/chat/adapter/EMAError;)V

    return-object v1
.end method

.method public getBlackListFromServer()Ljava/util/List;
    .locals 2

    new-instance v0, Lcom/hyphenate/chat/adapter/EMAError;

    invoke-direct {v0}, Lcom/hyphenate/chat/adapter/EMAError;-><init>()V

    iget-object v1, p0, Lcom/hyphenate/chat/EMContactManager;->emaObject:Lcom/hyphenate/chat/adapter/EMAContactManager;

    invoke-virtual {v1, v0}, Lcom/hyphenate/chat/adapter/EMAContactManager;->getBlackListFromServer(Lcom/hyphenate/chat/adapter/EMAError;)Ljava/util/List;

    move-result-object v1

    invoke-direct {p0, v0}, Lcom/hyphenate/chat/EMContactManager;->handleError(Lcom/hyphenate/chat/adapter/EMAError;)V

    return-object v1
.end method

.method public getBlackListUsernames()Ljava/util/List;
    .locals 2

    new-instance v0, Lcom/hyphenate/chat/adapter/EMAError;

    invoke-direct {v0}, Lcom/hyphenate/chat/adapter/EMAError;-><init>()V

    iget-object v1, p0, Lcom/hyphenate/chat/EMContactManager;->emaObject:Lcom/hyphenate/chat/adapter/EMAContactManager;

    invoke-virtual {v1, v0}, Lcom/hyphenate/chat/adapter/EMAContactManager;->getBlackListFromDB(Lcom/hyphenate/chat/adapter/EMAError;)Ljava/util/List;

    move-result-object v0

    return-object v0
.end method

.method getContactsFromDB(Lcom/hyphenate/chat/adapter/EMAError;)Ljava/util/List;
    .locals 1

    iget-object v0, p0, Lcom/hyphenate/chat/EMContactManager;->emaObject:Lcom/hyphenate/chat/adapter/EMAContactManager;

    invoke-virtual {v0, p1}, Lcom/hyphenate/chat/adapter/EMAContactManager;->getContactsFromDB(Lcom/hyphenate/chat/adapter/EMAError;)Ljava/util/List;

    move-result-object v0

    return-object v0
.end method

.method getContactsFromServer(Lcom/hyphenate/chat/adapter/EMAError;)Ljava/util/List;
    .locals 1

    iget-object v0, p0, Lcom/hyphenate/chat/EMContactManager;->emaObject:Lcom/hyphenate/chat/adapter/EMAContactManager;

    invoke-virtual {v0, p1}, Lcom/hyphenate/chat/adapter/EMAContactManager;->getContactsFromServer(Lcom/hyphenate/chat/adapter/EMAError;)Ljava/util/List;

    move-result-object v0

    return-object v0
.end method

.method onLogout()V
    .locals 0

    return-void
.end method

.method public removeContactListener(Lcom/hyphenate/EMContactListener;)V
    .locals 1

    iget-object v0, p0, Lcom/hyphenate/chat/EMContactManager;->contactListeners:Ljava/util/List;

    invoke-interface {v0, p1}, Ljava/util/List;->remove(Ljava/lang/Object;)Z

    return-void
.end method

.method public removeUserFromBlackList(Ljava/lang/String;)V
    .locals 2

    new-instance v0, Lcom/hyphenate/chat/adapter/EMAError;

    invoke-direct {v0}, Lcom/hyphenate/chat/adapter/EMAError;-><init>()V

    iget-object v1, p0, Lcom/hyphenate/chat/EMContactManager;->emaObject:Lcom/hyphenate/chat/adapter/EMAContactManager;

    invoke-virtual {v1, p1, v0}, Lcom/hyphenate/chat/adapter/EMAContactManager;->removeFromBlackList(Ljava/lang/String;Lcom/hyphenate/chat/adapter/EMAError;)V

    invoke-direct {p0, v0}, Lcom/hyphenate/chat/EMContactManager;->handleError(Lcom/hyphenate/chat/adapter/EMAError;)V

    return-void
.end method

.method public saveBlackList(Ljava/util/List;)V
    .locals 2

    new-instance v0, Lcom/hyphenate/chat/adapter/EMAError;

    invoke-direct {v0}, Lcom/hyphenate/chat/adapter/EMAError;-><init>()V

    iget-object v1, p0, Lcom/hyphenate/chat/EMContactManager;->emaObject:Lcom/hyphenate/chat/adapter/EMAContactManager;

    invoke-virtual {v1, p1, v0}, Lcom/hyphenate/chat/adapter/EMAContactManager;->saveBlackList(Ljava/util/List;Lcom/hyphenate/chat/adapter/EMAError;)V

    invoke-direct {p0, v0}, Lcom/hyphenate/chat/EMContactManager;->handleError(Lcom/hyphenate/chat/adapter/EMAError;)V

    return-void
.end method

.method public setContactListener(Lcom/hyphenate/EMContactListener;)V
    .locals 1

    iget-object v0, p0, Lcom/hyphenate/chat/EMContactManager;->contactListeners:Ljava/util/List;

    invoke-interface {v0, p1}, Ljava/util/List;->contains(Ljava/lang/Object;)Z

    move-result v0

    if-nez v0, :cond_0

    iget-object v0, p0, Lcom/hyphenate/chat/EMContactManager;->contactListeners:Ljava/util/List;

    invoke-interface {v0, p1}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    :cond_0
    return-void
.end method
